package com.lepu.app.fun.index.bean;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class BeanWriterHead {

	public String AuthorID;
	public String AuthorName;
	public String Resume;
	public String Avatar;
	public String RefreshTime;
	
	public static BeanWriterHead parseJsonData(String dataString) {
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = (JSONObject) obj1.get("DetailInfo");

			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}

		Gson gson = new Gson();
		BeanWriterHead beanHead = gson.fromJson(result, new TypeToken<BeanWriterHead>() {
	        }.getType());
		
		return beanHead;
	}
	
    //刷新时间
    public static String parseJsonDate(String dataString) {
    	String date = "";
        try {
            JSONObject jsonObject = new JSONObject(dataString);
            JSONObject obj1 = (JSONObject) jsonObject.get("Result");
            JSONObject objDetail = obj1.getJSONObject("DetailInfo");
            date = objDetail.getString("RefreshTime");

        } catch (JSONException e) {
            e.printStackTrace();
        }
        
        return date;
    }
	
}
